<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="../vue_base/js/vue.js"> </script>

    <script>

        function Vue(options){
            this._data = options.data

        Object.keys(this._data).forEach(key=>{
            
            Object.defineProperty(this,key,{
                get(){
                    console.log('111');
                    return this._data[key]
                },
                set(value){
                    console.log('222');
                    this._data[key] = value
                }
            })
        })
        }

      const vue = new Vue({
            data:{
                msg:'abc',
                msg2:'cba'
            }
        })

        console.log(vue);
        console.log(vue._data);
        console.log(vue.msg);
        vue.msg='qwe'
        console.log(vue.msg);
        console.log(vue._data.msg);
    </script>

</body>
</html>